package main

import (
	"cronexpr"
	"fmt"
	"time"
)

func main() {
	expr, err := cronexpr.Parse("*/1 * * * * * *")
	if err != nil {
		fmt.Println(err)
		return
	}

	now := time.Now()
	nextTime := expr.Next(now)

	time.AfterFunc(nextTime.Sub(now), func(){
		fmt.Println(now, nextTime)
	})

	time.Sleep(5 * time.Second)
}
